<template>

  <div>
    <el-input v-model="userName" placeholder="请输入账号"></el-input>
    <el-input v-model="password" placeholder="请输入密码"></el-input>
    <button @click="login">Login</button>
  </div>

</template>

<script>

    export default {
        name: "LoginChatRoom",
        data(){
          return{
            userName: '',
            password: '',

          }
        },
        methods: {
          login(){
            this.axios.get("medical/chat/login",{
              params:{
                userName : this.userName,
                password : this.password,
              }
            }).then(response => {
              if(response.data.code == 200){
                localStorage.setItem('user',this.userName);
                this.$router.push('/main/chat_room');
              }
            });
          }

        }
    }
</script>

<style scoped>

  div{
    margin:  0 auto;
    text-align: center;
  }

</style>
